replace all uses with const char * (non-interned).
Also remove a lot fo juggling from atom to GdkAtom to string and back.
The X Atom hash table is now mapping to (again, non-interned) strings.
gdk_x11_keymap_get_group_for_state
gdk_x11_keymap_key_is_modifier
gdk_x11_visual_get_xvisual
-gdk_x11_atom_to_xatom_for_display
-gdk_x11_xatom_to_atom_for_display
gdk_x11_get_xatom_by_name_for_display
gdk_x11_get_xatom_name_for_display
gdk_x11_set_sm_client_id
static gboolean initialized = FALSE;
static Atom label_atoms [GDK_AXIS_LAST] = { 0 };
GdkAxisUse use = GDK_AXIS_IGNORE;
- GdkAtom label;
+ const char *label;
gint i;
if (!initialized)
}
if (valuator_label != None)
- label = gdk_x11_xatom_to_atom_for_display (display, valuator_label);
+ label = gdk_x11_get_xatom_name_for_display (display, valuator_label);
else
label = NULL;
_gdk_device_add_axis (device, label, use, min, max, resolution);
- GDK_DISPLAY_NOTE (display, INPUT, g_message ("\n\taxis: %s %s", (const char *)label, use == GDK_AXIS_IGNORE ? "(ignored)" : "(used)"));
+ GDK_DISPLAY_NOTE (display, INPUT, g_message ("\n\taxis: %s %s", label, use == GDK_AXIS_IGNORE ? "(ignored)" : "(used)"));
}
static void
do_net_wm_state_changes (surface);
}
-static Atom
-get_cm_atom (GdkDisplay *display)
-{
- return _gdk_x11_get_xatom_for_display_printf (display, "_NET_WM_CM_S%d", DefaultScreen (GDK_DISPLAY_XDISPLAY (display)));
-}
-
static Window
get_event_xwindow (const XEvent *xevent)
{
GdkX11Display *display_x11;
gint argc;
gchar *argv[1];
-
XClassHint *class_hint;
gint ignore;
gint maj, min;
+ char *cm_name;
XInitThreads ();
* notification, and then setup the initial state of
* is_composited to avoid a race condition here.
*/
- gdk_x11_display_request_selection_notification (display,
- gdk_x11_xatom_to_atom_for_display (display, get_cm_atom (display)));
+ cm_name = g_strdup_printf ("_NET_WM_CM_S%d", DefaultScreen (GDK_DISPLAY_XDISPLAY (display)));
+ gdk_x11_display_request_selection_notification (display, cm_name);
gdk_display_set_composited (GDK_DISPLAY (display),
- XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display), get_cm_atom (display)) != None);
+ XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display),
+ gdk_x11_get_xatom_by_name_for_display (display, cm_name)) != None);
+ g_free (cm_name);
gdk_display_emit_opened (display);
g_slist_free_full (display_x11->streams, g_object_unref);
/* Atom Hashtable */
- g_hash_table_destroy (display_x11->atom_from_virtual);
- g_hash_table_destroy (display_x11->atom_to_virtual);
+ g_hash_table_destroy (display_x11->atom_from_string);
+ g_hash_table_destroy (display_x11->atom_to_string);
/* Leader Window */
XDestroyWindow (display_x11->xdisplay, display_x11->leader_window);
GdkDrop *current_drop;
/* Mapping to/from virtual atoms */
- GHashTable *atom_from_virtual;
- GHashTable *atom_to_virtual;
+ GHashTable *atom_from_string;
+ GHashTable *atom_to_string;
/* Session Management leader window see ICCCM */
char *program_class;
GdkDrag *drag = GDK_DRAG (drag_x11);
GdkDisplay *display = gdk_drag_get_display (drag);
GdkContentFormats *formats;
- const char * const *atoms;
- gsize i, n_atoms;
+ const char * const *mime_types;
+ gsize i, n_mime_types;
XEvent xev;
xev.xclient.type = ClientMessage;
formats = gdk_content_formats_ref (gdk_drag_get_formats (drag));
formats = gdk_content_formats_union_serialize_mime_types (formats);
- atoms = gdk_content_formats_get_mime_types (formats, &n_atoms);
+ mime_types = gdk_content_formats_get_mime_types (formats, &n_mime_types);
- if (n_atoms > 3)
+ if (n_mime_types > 3)
{
if (!drag_x11->xdnd_targets_set)
xdnd_set_targets (drag_x11);
}
else
{
- for (i = 0; i < n_atoms; i++)
+ for (i = 0; i < n_mime_types; i++)
{
- xev.xclient.data.l[i + 2] = gdk_x11_atom_to_xatom_for_display (display, atoms[i]);
+ xev.xclient.data.l[i + 2] = gdk_x11_get_xatom_by_name_for_display (display, mime_types[i]);
}
}
GdkAppLaunchContext *_gdk_x11_display_get_app_launch_context (GdkDisplay *display);
gint _gdk_x11_display_text_property_to_utf8_list (GdkDisplay *display,
- GdkAtom encoding,
+ const char *encoding,
gint format,
const guchar *text,
gint length,
gdouble *axes,
gint n_axes);
-GdkAtom _gdk_x11_display_manager_atom_intern (GdkDisplayManager *manager,
- const gchar *atom_name,
- gboolean copy_name);
-gchar * _gdk_x11_display_manager_get_atom_name (GdkDisplayManager *manager,
- GdkAtom atom);
-
gboolean _gdk_x11_display_supports_cursor_alpha (GdkDisplay *display);
gboolean _gdk_x11_display_supports_cursor_color (GdkDisplay *display);
void _gdk_x11_display_get_default_cursor_size (GdkDisplay *display,
static void
insert_atom_pair (GdkDisplay *display,
- GdkAtom virtual_atom,
+ const char *string,
Atom xatom)
{
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
+ char *s;
- if (!display_x11->atom_from_virtual)
+ if (!display_x11->atom_from_string)
{
- display_x11->atom_from_virtual = g_hash_table_new (g_direct_hash, NULL);
- display_x11->atom_to_virtual = g_hash_table_new (g_direct_hash, NULL);
+ display_x11->atom_from_string = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+ display_x11->atom_to_string = g_hash_table_new (NULL, NULL);
}
- g_hash_table_insert (display_x11->atom_from_virtual, (gpointer)virtual_atom,
- GUINT_TO_POINTER (xatom));
- g_hash_table_insert (display_x11->atom_to_virtual,
- GUINT_TO_POINTER (xatom), (gpointer)virtual_atom);
+ s = g_strdup (string);
+ g_hash_table_insert (display_x11->atom_from_string, s, GUINT_TO_POINTER (xatom));
+ g_hash_table_insert (display_x11->atom_to_string, GUINT_TO_POINTER (xatom), s);
}
static Atom
lookup_cached_xatom (GdkDisplay *display,
- GdkAtom atom)
+ const char *string)
{
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
- if (display_x11->atom_from_virtual)
- return GPOINTER_TO_UINT (g_hash_table_lookup (display_x11->atom_from_virtual, atom));
+ if (display_x11->atom_from_string)
+ return GPOINTER_TO_UINT (g_hash_table_lookup (display_x11->atom_from_string, string));
return None;
}
/**
- * gdk_x11_atom_to_xatom_for_display:
- * @display: (type GdkX11Display): A #GdkDisplay
- * @atom: A #GdkAtom, or %NULL
- *
- * Converts from a #GdkAtom to the X atom for a #GdkDisplay
- * with the same string value. The special value %NULL
- * is converted to %None.
- *
- * Returns: the X atom corresponding to @atom, or %None
+ * gdk_x11_get_xatom_by_name_for_display:
+ * @display: (type GdkX11Display): a #GdkDisplay
+ * @atom_name: a string
+ *
+ * Returns the X atom for a #GdkDisplay corresponding to @atom_name.
+ * This function caches the result, so if called repeatedly it is much
+ * faster than XInternAtom(), which is a round trip to the server each time.
+ *
+ * Returns: a X atom for a #GdkDisplay
**/
Atom
-gdk_x11_atom_to_xatom_for_display (GdkDisplay *display,
- GdkAtom atom)
+gdk_x11_get_xatom_by_name_for_display (GdkDisplay *display,
+ const gchar *atom_name)
{
Atom xatom = None;
g_return_val_if_fail (GDK_IS_DISPLAY (display), None);
- if (atom == NULL)
+ if (atom_name == NULL)
return None;
if (gdk_display_is_closed (display))
return None;
- xatom = lookup_cached_xatom (display, atom);
+ xatom = lookup_cached_xatom (display, atom_name);
if (!xatom)
{
- const char *name = (const char *)atom;
-
- xatom = XInternAtom (GDK_DISPLAY_XDISPLAY (display), name, FALSE);
- insert_atom_pair (display, atom, xatom);
+ xatom = XInternAtom (GDK_DISPLAY_XDISPLAY (display), atom_name, FALSE);
+ insert_atom_pair (display, atom_name, xatom);
}
return xatom;
gint n_atoms)
{
Atom *xatoms;
- GdkAtom *atoms;
- const gchar **xatom_names;
+ const char **xatom_names;
gint n_xatoms;
gint i;
xatoms = g_new (Atom, n_atoms);
- xatom_names = g_new (const gchar *, n_atoms);
- atoms = g_new (GdkAtom, n_atoms);
+ xatom_names = g_new (const char *, n_atoms);
n_xatoms = 0;
for (i = 0; i < n_atoms; i++)
{
- GdkAtom atom = g_intern_static_string (atom_names[i]);
- if (lookup_cached_xatom (display, atom) == None)
+ if (lookup_cached_xatom (display, atom_names[i]) == None)
{
- atoms[n_xatoms] = atom;
xatom_names[n_xatoms] = atom_names[i];
n_xatoms++;
}
if (n_xatoms)
XInternAtoms (GDK_DISPLAY_XDISPLAY (display),
- (char **)xatom_names, n_xatoms, False, xatoms);
+ (char **) xatom_names, n_xatoms, False, xatoms);
for (i = 0; i < n_xatoms; i++)
- insert_atom_pair (display, atoms[i], xatoms[i]);
+ insert_atom_pair (display, xatom_names[i], xatoms[i]);
g_free (xatoms);
g_free (xatom_names);
- g_free (atoms);
}
/**
- * gdk_x11_xatom_to_atom_for_display:
- * @display: (type GdkX11Display): A #GdkDisplay
+ * gdk_x11_get_xatom_name_for_display:
+ * @display: (type GdkX11Display): the #GdkDisplay where @xatom is defined
* @xatom: an X atom
*
- * Convert from an X atom for a #GdkDisplay to the corresponding
- * #GdkAtom.
- *
- * Returns: (transfer none): the corresponding #GdkAtom.
+ * Returns the name of an X atom for its display. This
+ * function is meant mainly for debugging, so for convenience, unlike
+ * XAtomName() and the result doesn’t need to
+ * be freed.
+ *
+ * Returns: name of the X atom; this string is owned by GDK,
+ * so it shouldn’t be modifed or freed.
**/
-GdkAtom
-gdk_x11_xatom_to_atom_for_display (GdkDisplay *display,
- Atom xatom)
+const gchar *
+gdk_x11_get_xatom_name_for_display (GdkDisplay *display,
+ Atom xatom)
+
{
GdkX11Display *display_x11;
- GdkAtom virtual_atom = NULL;
+ const char *string;
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
display_x11 = GDK_X11_DISPLAY (display);
- if (display_x11->atom_to_virtual)
- virtual_atom = g_hash_table_lookup (display_x11->atom_to_virtual,
- GUINT_TO_POINTER (xatom));
+ if (display_x11->atom_to_string)
+ string = g_hash_table_lookup (display_x11->atom_to_string,
+ GUINT_TO_POINTER (xatom));
+ else
+ string = NULL;
- if (!virtual_atom)
+ if (!string)
{
/* If this atom doesn't exist, we'll die with an X error unless
* we take precautions
}
else
{
- virtual_atom = g_intern_string (name);
+ insert_atom_pair (display, name, xatom);
XFree (name);
-
- insert_atom_pair (display, virtual_atom, xatom);
+ string = g_hash_table_lookup (display_x11->atom_to_string,
+ GUINT_TO_POINTER (xatom));
}
}
- return virtual_atom;
-}
-
-/**
- * gdk_x11_get_xatom_by_name_for_display:
- * @display: (type GdkX11Display): a #GdkDisplay
- * @atom_name: a string
- *
- * Returns the X atom for a #GdkDisplay corresponding to @atom_name.
- * This function caches the result, so if called repeatedly it is much
- * faster than XInternAtom(), which is a round trip to the server each time.
- *
- * Returns: a X atom for a #GdkDisplay
- **/
-Atom
-gdk_x11_get_xatom_by_name_for_display (GdkDisplay *display,
- const gchar *atom_name)
-{
- g_return_val_if_fail (GDK_IS_DISPLAY (display), None);
- return gdk_x11_atom_to_xatom_for_display (display, g_intern_string (atom_name));
+ return string;
}
Atom
return atom;
}
-/**
- * gdk_x11_get_xatom_name_for_display:
- * @display: (type GdkX11Display): the #GdkDisplay where @xatom is defined
- * @xatom: an X atom
- *
- * Returns the name of an X atom for its display. This
- * function is meant mainly for debugging, so for convenience, unlike
- * XAtomName() and the result doesn’t need to
- * be freed.
- *
- * Returns: name of the X atom; this string is owned by GDK,
- * so it shouldn’t be modifed or freed.
- **/
-const gchar *
-gdk_x11_get_xatom_name_for_display (GdkDisplay *display,
- Atom xatom)
-{
- g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
-
- return (const char *)gdk_x11_xatom_to_atom_for_display (display, xatom);
-}
-
/**
* gdk_x11_screen_supports_net_wm_hint:
* @screen: the relevant #GdkX11Screen.
- * @property: a property atom.
+ * @property_name: name of the WM property
*
* This function is specific to the X11 backend of GDK, and indicates
* whether the window manager supports a certain hint from the
**/
gboolean
gdk_x11_screen_supports_net_wm_hint (GdkX11Screen *x11_screen,
- GdkAtom property)
+ const char *property_name)
{
gulong i;
NetWmSupportedAtoms *supported_atoms;
if (supported_atoms->atoms == NULL)
return FALSE;
- atom = gdk_x11_atom_to_xatom_for_display (display, property);
+ atom = gdk_x11_get_xatom_by_name_for_display (display, property_name);
for (i = 0; i < supported_atoms->n_atoms; i++)
{
get_netwm_cardinal_property (GdkX11Screen *x11_screen,
const gchar *name)
{
- GdkAtom atom;
guint32 prop = 0;
Atom type;
gint format;
gulong bytes_after;
guchar *data;
- atom = g_intern_static_string (name);
-
- if (!gdk_x11_screen_supports_net_wm_hint (x11_screen, atom))
+ if (!gdk_x11_screen_supports_net_wm_hint (x11_screen, name))
return 0;
XGetWindowProperty (x11_screen->xdisplay,
/**
* gdk_x11_display_text_property_to_text_list:
* @display: (type GdkX11Display): The #GdkDisplay where the encoding is defined
- * @encoding: an atom representing the encoding. The most
- * common values for this are STRING, or COMPOUND_TEXT.
+ * @encoding: a string representing the encoding. The most
+ * common values for this are "STRING", or "COMPOUND_TEXT".
* This is value used as the type for the property
* @format: the format of the property
* @text: The text data
*/
gint
gdk_x11_display_text_property_to_text_list (GdkDisplay *display,
- GdkAtom encoding,
+ const char *encoding,
gint format,
const guchar *text,
gint length,
return 0;
property.value = (guchar *)text;
- property.encoding = gdk_x11_atom_to_xatom_for_display (display, encoding);
+ property.encoding = gdk_x11_get_xatom_by_name_for_display (display, encoding);
property.format = format;
property.nitems = length;
res = XmbTextPropertyToTextList (GDK_DISPLAY_XDISPLAY (display), &property,
gint
_gdk_x11_display_text_property_to_utf8_list (GdkDisplay *display,
- GdkAtom encoding,
+ const char *encoding,
gint format,
const guchar *text,
gint length,
gchar ***list)
{
- if (encoding == g_intern_static_string ("STRING"))
+ if (g_str_equal (encoding, "STRING"))
{
return make_list ((gchar *)text, length, TRUE, list);
}
- else if (encoding == g_intern_static_string ("UTF8_STRING"))
+ else if (g_str_equal (encoding, "UTF8_STRING"))
{
return make_list ((gchar *)text, length, FALSE, list);
}
* gdk_x11_display_string_to_compound_text:
* @display: (type GdkX11Display): the #GdkDisplay where the encoding is defined
* @str: a nul-terminated string
- * @encoding: (out) (transfer none): location to store the encoding atom
+ * @encoding: (out) (transfer none): location to store the encoding
* (to be used as the type for the property)
* @format: (out): location to store the format of the property
* @ctext: (out) (array length=length): location to store newly
*/
gint
gdk_x11_display_string_to_compound_text (GdkDisplay *display,
- const gchar *str,
- GdkAtom *encoding,
+ const char *str,
+ const char **encoding,
gint *format,
guchar **ctext,
gint *length)
}
if (encoding)
- *encoding = gdk_x11_xatom_to_atom_for_display (display, property.encoding);
+ *encoding = gdk_x11_get_xatom_name_for_display (display, property.encoding);
if (format)
*format = property.format;
if (ctext)
* gdk_x11_display_utf8_to_compound_text:
* @display: (type GdkX11Display): a #GdkDisplay
* @str: a UTF-8 string
- * @encoding: (out): location to store resulting encoding
+ * @encoding: (out) (transfer none): location to store resulting encoding
* @format: (out): location to store format of the result
* @ctext: (out) (array length=length): location to store the data of the result
* @length: location to store the length of the data
*/
gboolean
gdk_x11_display_utf8_to_compound_text (GdkDisplay *display,
- const gchar *str,
- GdkAtom *encoding,
+ const char *str,
+ const char **encoding,
gint *format,
guchar **ctext,
gint *length)
g_error_free (error);
if (encoding)
- *encoding = None;
+ *encoding = NULL;
if (format)
*format = None;
if (ctext)
const gchar *name)
{
GdkX11Screen *x11_screen = GDK_SURFACE_SCREEN (surface);
- GdkAtom atom;
guint32 prop = 0;
Atom type;
gint format;
gulong bytes_after;
guchar *data;
- atom = g_intern_static_string (name);
-
- if (!gdk_x11_screen_supports_net_wm_hint (x11_screen, atom))
+ if (!gdk_x11_screen_supports_net_wm_hint (x11_screen, name))
return 0;
XGetWindowProperty (x11_screen->xdisplay,
gdk_x11_surface_move_to_desktop (GdkSurface *surface,
guint32 desktop)
{
- GdkAtom atom;
+ const char *atom_name = "_NET_WM_DESKTOP";
XClientMessageEvent xclient;
g_return_if_fail (GDK_IS_SURFACE (surface));
- atom = g_intern_static_string ("_NET_WM_DESKTOP");
- if (!gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (surface), atom))
+ if (!gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (surface), atom_name))
return;
memset (&xclient, 0, sizeof (xclient));
xclient.serial = 0;
xclient.send_event = True;
xclient.window = GDK_SURFACE_XID (surface);
- xclient.message_type = gdk_x11_atom_to_xatom_for_display (GDK_SURFACE_DISPLAY (surface), atom);
+ xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (surface), atom_name);
xclient.format = 32;
xclient.data.l[0] = desktop;
}
static void
-gdk_wmspec_change_state (gboolean add,
+gdk_wmspec_change_state (gboolean add,
GdkSurface *surface,
- GdkAtom state1,
- GdkAtom state2)
+ const char *state1,
+ const char *state2)
{
GdkDisplay *display = GDK_SURFACE_DISPLAY (surface);
XClientMessageEvent xclient;
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE");
xclient.format = 32;
xclient.data.l[0] = add ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
- xclient.data.l[1] = gdk_x11_atom_to_xatom_for_display (display, state1);
- xclient.data.l[2] = gdk_x11_atom_to_xatom_for_display (display, state2);
+ xclient.data.l[1] = gdk_x11_get_xatom_by_name_for_display (display, state1);
+ xclient.data.l[2] = gdk_x11_get_xatom_by_name_for_display (display, state2);
xclient.data.l[3] = 1; /* source indication */
xclient.data.l[4] = 0;
if (GDK_SURFACE_IS_MAPPED (surface))
gdk_wmspec_change_state (modal, surface,
- g_intern_static_string ("_NET_WM_STATE_MODAL"),
+ "_NET_WM_STATE_MODAL",
NULL);
}
if (GDK_SURFACE_IS_MAPPED (surface))
gdk_wmspec_change_state (skips_taskbar, surface,
- g_intern_static_string ("_NET_WM_STATE_SKIP_TASKBAR"),
+ "_NET_WM_STATE_SKIP_TASKBAR",
NULL);
}
if (GDK_SURFACE_IS_MAPPED (surface))
gdk_wmspec_change_state (skips_pager, surface,
- g_intern_static_string ("_NET_WM_STATE_SKIP_PAGER"),
+ "_NET_WM_STATE_SKIP_PAGER",
NULL);
}
}
else
{
- GdkAtom gdk_type;
+ const char *gdk_type;
gdk_x11_display_utf8_to_compound_text (display,
utf8_str, &gdk_type, &prop_format,
(guchar **)&prop_text, &prop_length);
- prop_type = gdk_x11_atom_to_xatom_for_display (display, gdk_type);
+ prop_type = gdk_x11_get_xatom_by_name_for_display (display, gdk_type);
is_compound_text = TRUE;
}
/* Flip our client side flag, the real work happens on map. */
gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_MINIMIZED);
gdk_wmspec_change_state (TRUE, surface,
- g_intern_static_string ("_NET_WM_STATE_HIDDEN"),
+ "_NET_WM_STATE_HIDDEN",
NULL);
}
}
{
gdk_surface_show (surface);
gdk_wmspec_change_state (FALSE, surface,
- g_intern_static_string ("_NET_WM_STATE_HIDDEN"),
+ "_NET_WM_STATE_HIDDEN",
NULL);
}
else
/* Flip our client side flag, the real work happens on map. */
gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_MINIMIZED, 0);
gdk_wmspec_change_state (FALSE, surface,
- g_intern_static_string ("_NET_WM_STATE_HIDDEN"),
+ "_NET_WM_STATE_HIDDEN",
NULL);
}
}
/* Request stick during viewport scroll */
gdk_wmspec_change_state (TRUE, surface,
- g_intern_static_string ("_NET_WM_STATE_STICKY"),
+ "_NET_WM_STATE_STICKY",
NULL);
/* Request desktop 0xFFFFFFFF */
{
/* Request unstick from viewport */
gdk_wmspec_change_state (FALSE, surface,
- g_intern_static_string ("_NET_WM_STATE_STICKY"),
+ "_NET_WM_STATE_STICKY",
NULL);
move_to_current_desktop (surface);
if (GDK_SURFACE_IS_MAPPED (surface))
gdk_wmspec_change_state (TRUE, surface,
- g_intern_static_string ("_NET_WM_STATE_MAXIMIZED_VERT"),
- g_intern_static_string ("_NET_WM_STATE_MAXIMIZED_HORZ"));
+ "_NET_WM_STATE_MAXIMIZED_VERT",
+ "_NET_WM_STATE_MAXIMIZED_HORZ");
else
gdk_synthesize_surface_state (surface,
0,
if (GDK_SURFACE_IS_MAPPED (surface))
gdk_wmspec_change_state (FALSE, surface,
- g_intern_static_string ("_NET_WM_STATE_MAXIMIZED_VERT"),
- g_intern_static_string ("_NET_WM_STATE_MAXIMIZED_HORZ"));
+ "_NET_WM_STATE_MAXIMIZED_VERT",
+ "_NET_WM_STATE_MAXIMIZED_HORZ");
else
gdk_synthesize_surface_state (surface,
GDK_SURFACE_STATE_MAXIMIZED,
if (GDK_SURFACE_IS_MAPPED (surface))
{
gdk_wmspec_change_state (TRUE, surface,
- g_intern_static_string ("_NET_WM_STATE_FULLSCREEN"),
+ "_NET_WM_STATE_FULLSCREEN",
NULL);
/* Actual XRandR layout may have change since we computed the fullscreen
* monitors in GDK_FULLSCREEN_ON_ALL_MONITORS mode.
if (GDK_SURFACE_IS_MAPPED (surface))
gdk_wmspec_change_state (FALSE, surface,
- g_intern_static_string ("_NET_WM_STATE_FULLSCREEN"),
+ "_NET_WM_STATE_FULLSCREEN",
NULL);
else
{
if (setting)
gdk_wmspec_change_state (FALSE, surface,
- g_intern_static_string ("_NET_WM_STATE_BELOW"),
+ "_NET_WM_STATE_BELOW",
NULL);
gdk_wmspec_change_state (setting, surface,
- g_intern_static_string ("_NET_WM_STATE_ABOVE"),
+ "_NET_WM_STATE_ABOVE",
NULL);
}
else
{
if (setting)
gdk_wmspec_change_state (FALSE, surface,
- g_intern_static_string ("_NET_WM_STATE_ABOVE"),
+ "_NET_WM_STATE_ABOVE",
NULL);
gdk_wmspec_change_state (setting, surface,
- g_intern_static_string ("_NET_WM_STATE_BELOW"),
+ "_NET_WM_STATE_BELOW",
NULL);
}
else
{
GConverterResult result;
guchar *text;
- GdkAtom encoding;
+ const char *encoding;
gint format;
gint new_length;
char *tmp;
if (gdk_x11_display_utf8_to_compound_text (conv->display, tmp,
&encoding, &format, &text, &new_length))
{
- if (encoding == g_intern_string (conv->encoding) &&
+ if (g_str_equal (encoding, conv->encoding) &&
format == conv->format)
{
result = write_output (outbuf, outbuf_size, bytes_written, text, new_length, error);
G_BEGIN_DECLS
-/* Functions to get the X Atom equivalent to the GdkAtom */
-GDK_AVAILABLE_IN_ALL
-Atom gdk_x11_atom_to_xatom_for_display (GdkDisplay *display,
- GdkAtom atom);
-GDK_AVAILABLE_IN_ALL
-GdkAtom gdk_x11_xatom_to_atom_for_display (GdkDisplay *display,
- Atom xatom);
GDK_AVAILABLE_IN_ALL
Atom gdk_x11_get_xatom_by_name_for_display (GdkDisplay *display,
const gchar *atom_name);
GDK_AVAILABLE_IN_ALL
gboolean gdk_x11_screen_supports_net_wm_hint (GdkX11Screen *screen,
- GdkAtom property);
+ const char *property_name);
GDK_AVAILABLE_IN_ALL
XID gdk_x11_screen_get_monitor_output (GdkX11Screen *screen,
GDK_AVAILABLE_IN_ALL
gint gdk_x11_display_text_property_to_text_list (GdkDisplay *display,
- GdkAtom encoding,
+ const char *encoding,
gint format,
const guchar *text,
gint length,
void gdk_x11_free_text_list (gchar **list);
GDK_AVAILABLE_IN_ALL
gint gdk_x11_display_string_to_compound_text (GdkDisplay *display,
- const gchar *str,
- GdkAtom *encoding,
+ const char *str,
+ const char **encoding,
gint *format,
guchar **ctext,
gint *length);
GDK_AVAILABLE_IN_ALL
gboolean gdk_x11_display_utf8_to_compound_text (GdkDisplay *display,
- const gchar *str,
- GdkAtom *encoding,
+ const char *str,
+ const char **encoding,
gint *format,
guchar **ctext,
gint *length);